<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <th:block th:replace="~{/_include/header}" />
    <meta name="page-help" content="https://getrebuild.com/docs/manual/project-task" />
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/project-tasks.css}" />
    <title th:text="${projectName} + ' · ' + ${bundle.L('项目')}"></title>
  </head>
  <body>
    <div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo" th:classappend="${sideCollapsedClazz}">
      <th:block th:replace="~{/_include/nav-top}" />
      <th:block th:replace="~{/_include/nav-left(active=${'nav_project-' + projectId})}" />
      <div class="rb-loading rb-loading-active must-center J_project-load">
        <th:block th:replace="~{/_include/spinner}" />
      </div>
      <div class="rb-content">
        <div class="main-content container-fluid p-0">
          <div class="ps-toolbar">
            <div class="row">
              <div class="col-sm-5">
                <div class="project-head">
                  <h4>
                    [[${projectName}]]
                    <span th:if="${scope == 1}" class="badge badge-secondary up-2">[[${bundle.L('公开')}]]</span>
                    <span th:if="${status == 2}" class="badge badge-secondary up-2">[[${bundle.L('已归档')}]]</span>
                  </h4>
                  <div class="project-action">
                    <span class="admin-show">
                      <a th:href="${baseUrl} + '/admin/project/' + ${projectId}" th:title="${bundle.L('项目管理')}" target="_blank" class="zicon">
                        <i class="zmdi zmdi-settings"></i>
                      </a>
                    </span>
                  </div>
                </div>
              </div>
              <div class="col-sm-7 text-right d-none d-md-block">
                <div class="btn-group J_sorts float-right">
                  <button type="button" class="btn btn-link" data-toggle="dropdown">
                    <i class="icon mdi mdi-view-carousel-outline"></i>
                    <span>[[${bundle.L('显示方式')}]]</span>
                  </button>
                  <div class="dropdown-menu dropdown-menu-right">
                    <span class="dropdown-item-text">[[${bundle.L('排序')}]]</span>
                    <a class="dropdown-item check" data-sort="seq">[[${bundle.L('手动拖动')}]]</a>
                    <a class="dropdown-item" data-sort="deadline">[[${bundle.L('最近到期')}]]</a>
                    <a class="dropdown-item" data-sort="modifiedOn">[[${bundle.L('最近修改')}]]</a>
                    <span class="dropdown-item-text">[[${bundle.L('排列方式')}]]</span>
                    <a class="dropdown-item" data-group="plan" href="?group=plan">[[${bundle.L('按任务面板')}]]</a>
                    <a class="dropdown-item" data-group="priority" href="?group=priority">[[${bundle.L('按优先级')}]]</a>
                    <a class="dropdown-item" data-group="deadline" href="?group=deadline">[[${bundle.L('按到期时间')}]]</a>
                    <a class="dropdown-item" data-group="modified" href="?group=modified">[[${bundle.L('按修改时间')}]]</a>
                  </div>
                </div>
                <div class="btn-group J_view float-right">
                  <button type="button" class="btn btn-link" data-toggle="dropdown">
                    <th:block th:if="${view == 1}">
                      <i class="icon mdi mdi-view-week"></i>
                      <span>[[${bundle.L('看板')}]]</span>
                    </th:block>
                    <th:block th:if="${view == 2}">
                      <i class="icon mdi mdi-format-list-checkbox"></i>
                      <span>[[${bundle.L('列表')}]]</span>
                    </th:block>
                  </button>
                  <div class="dropdown-menu dropdown-menu-right">
                    <a class="dropdown-item" th:href="${view == 1 ? 'tasks' : '../tasks'}">
                      <i class="icon mdi mdi-view-week"></i>
                      [[${bundle.L('看板视图')}]]
                    </a>
                    <a class="dropdown-item" th:href="${view == 1 ? 'tasks/list' : '../tasks/list'}">
                      <i class="icon mdi mdi-format-list-checkbox"></i>
                      [[${bundle.L('列表视图')}]]
                    </a>
                  </div>
                </div>
                <div class="input-group input-search J_search float-right">
                  <input class="form-control" type="text" th:placeholder="${bundle.L('搜索标题和 ID')}" />
                  <button class="btn btn-input-clear" type="button"></button>
                  <span class="input-group-btn">
                    <button class="btn btn-secondary" type="button"><i class="icon zmdi zmdi-search"></i></button>
                  </span>
                  <span class="input-group-append">
                    <button class="btn btn-secondary w-auto J_filterbtn" type="button"><i class="icon mdi mdi-filter"></i></button>
                    <i class="indicator-primary bg-warning hide" style="top: 5px; right: 5px; z-index: 2"></i>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div id="plan-boxes" data-fullcontent="115"></div>
        </div>
      </div>
    </div>
    <th:block th:replace="~{/_include/footer}" />
    <script>
      window.__PageConfig = {
        type: 'TaskList',
        id: '[[${projectId}]]',
        icon: '[[${iconName}]]',
        projectCode: '[[${projectCode}]]',
        projectName: '[[${projectName}]]',
        projectPlans: [(${projectPlans ?:'null'})],
        isMember: '[[${isMember}]]' === 'true',
        status: [[${status}]],
      }
    </script>
    <th:block th:replace="~{/_include/forms}" />
    <script th:src="@{/assets/js/project/project-tasks.js}" type="text/babel"></script>
  </body>
</html>
